﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VRacer.Exceptions
{
    public class CannotReadTrackException : UIException, IVRacerException
    {
        private string _track;


        public CannotReadTrackException(Exception innerException, string trackName)
            : this("This application can't read one of its tracks (" + trackName + "). Check if file is in place and if its valid.", innerException)
        {
            _track = trackName;
        }

        protected CannotReadTrackException(string message, Exception innerException)
            : base(message, innerException)
        {
            Title = "Cannot read track";
            Code = 3;
            Details = "Vector Racer uses 'track.xml' file to store track information. This message means that this application can't access this file. It is possible that this file was accidentally moved or renamed or even damaged.";
        }

        public string Track
        {
            get { return _track; }
            set { _track = value; }
        }


        #region IVRacerException Members

        public bool Critical
        {
            get { return true; }
        }

        #endregion
    }
}
